FROM centos:centos7.1.1503
MAINTAINER kongjie kj_0801@163.com
ADD aliyun-mirror.repo /etc/yum.repos.d/CentOS-Base.repo
ADD aliyun-epel.repo /etc/yum.repos.d/epel.repo
RUN yum swap -y fakesystemd systemd && \
    yum install -y systemd-devel
RUN yum install openssh-server pcre-devel wget net-tools gcc zlib zlib-devel make openssl-devel -y
ADD http://download.redis.io/releases/redis-3.2.5.tar.gz /opt
RUN cd /opt && tar -zxvf redis-3.2.5.tar.gz
RUN cd /opt/redis-3.2.5 && make
RUN cd /opt/redis-3.2.5/src && make install
RUN mkdir -p /var/run/sshd
RUN mkdir -p /root/.ssh
RUN sed -ri 's/session    required     pam_loginuid.so/#session    required     pam_loginuid.so/g' /etc/pam.d/sshd
RUN ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key
RUN ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key
RUN cd /opt/redis-3.2.5\
&&make\
&&cd /opt/redis-3.2.5/src\
&&make install
EXPOSE 6379
RUN echo "#!/bin/bash" > /root/run.sh
RUN echo "/usr/local/bin/redis-server">> /root/run.sh
RUN echo "/usr/sbin/sshd -D ">> /root/run.sh
RUN chmod 755 /root/run.sh
CMD ["/root/run.sh"]

